<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>讲个故事</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=0.5, maximum-scale=2.0, user-scalable=yes" />
</head>
<body>
<div>
    <p style="text-align: center;"><span style="font-size:1.5rem">我来给你讲个故事吧</span><span>（彩蛋版）</span></p>
</div>
<div>
    <button class="btn btn-success" onclick="showStory(1);">好</button>
</div>
<div>
    <button class="btn btn-success" onclick="showStory(0);">不好</button>
</div>
<div>
    <p id="ewm" style="text-align: center;display: none">
        <img src="./erweima.jpg" />
    </p>
</div>
<style>
    .btn {
        display: inline-block;
        font-weight: 400;
        text-align: center;
        white-space: nowrap;
        vertical-align: middle;
        user-select: none;
        border: 1px solid transparent;
        padding: .65rem 1.25rem;
        font-size: 1rem;
        line-height: 1.25;
        border-radius: .25rem;
        transition: all .15s ease-in-out;
        margin-right: 5px;
        margin-bottom: 15px;
        width: 100%;
    }
    .btn-success {
        color: #fff;
        background-color: #34bfa3;
        border-color: #34bfa3;
    }
    .btn.m-btn--wide {
        padding-left: 2.5rem;
        padding-right: 2.5rem;
    }
    .m-demo .m-demo__preview.m-demo__preview--btn .btn {
        margin-right: 5px;
        margin-bottom: 15px;
    }
</style>
<script>

    function showStory(index){
        if(index == 0){
            alert('还是讲一个吧');
        }
        var story = ['从前有座山','山里有个庙','庙里有个老和尚','给小和尚讲故事','讲的什么呢？'];
        var i=0,j=0;
        var story_long = story.length;
        for(;i<story_long;){
            alert(story[i]);
            i++;
            if(i==story_long){
                i=0;
                j++;
                if(j==5){
                    surprise();
                    return true;
                }
            }
        }
    }


    function surprise(){
        alert('不讲了')
        alert('老和尚讲累了，喜欢故事自己去看...');
        document.getElementById('ewm').style.display='';
    }
</script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "https://hm.baidu.com/hm.js?2e06e82d5fd726aa571fd013065cb5d6";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>
</body>
</html>